<extend name="Public:base" />
<block name="Controller">AppInfo</block>
<block name="Main">
    <div class="col-md-10 main padding">
    <div class="cl">
        <div class="fl"><h2>导航列表</h2></div>
        <div class="fr">
            <a class="btn btn-warning" href="{:U('Admin/Nav/design')}">导航设计</a>
            <a class="btn btn-primary" href="{:U('Admin/Nav/add')}">新增导航</a>
        </div>
    </div>
        <table class="table" >
                <tbody>
                    <volist name="navs" id="nav">
                    <tr >
                        <td>{$nav.idx}</td>
                        <td>
                        {$nav.icon}
                        <a href="#" data-name="name" class="editable" data-type="text" data-pk="{$nav.id}">{$nav.name}</a>
                        </td>
                        <td>
                            <if condition="$nav[module] eq 'url' ">
                            <a target="_blank" class="color theme" href="{$nav.url}">{$nav.module_text}</a>
                            <else />
                            {$nav.module_text}
                            </if>
                        </td>
                        <td width="150">
                        <a href="{:U("Admin/Nav/edit?id=$nav[id]")}" class="button small theme" >编辑</a>
                        <a delete href="{:U("Admin/Nav/delete?id=$nav[id]")}" class="button small" >删除</a></td>
                    </tr>
                    </volist>
                </tbody>
            </table>
    </div>

<load href="Public/fancyBox/jquery.fancybox.css" />
<script type="text/javascript">
require("nprogress/nprogress,jquery,app,jquery.validate,fancyBox/jquery.fancybox", function(nprogress,$,app,validate) {
    $(".fancybox").fancybox({
        maxWidth    : 800,
        maxHeight   : 900,
        fitToView   : false,
        width       : '70%',
        height      : '70%',
        autoSize    : false,
        closeClick  : false,
        openEffect  : 'none',
        closeEffect : 'none'
    });

    $('.form-validate').each(function() {
        var $obj = $(this);
        $obj.validate(app.validateOpt());
    });

    var AppInfo = avalon.define('AppInfo', function(vm) {
        //
    })
    avalon.scan()
}) 

</script>    
</block>